package com.ms.service.gmtool.log;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import com.xpec.c4.db.model.log.basic.BasicLogModel;
import com.xpec.c4.service.annotations.In;

/**
 *  角色登錄記錄
 */
@Entity
@org.hibernate.annotations.Entity(dynamicInsert=true,dynamicUpdate=true)
@Table(name="player_login")
@org.hibernate.annotations.Table(
		appliesTo = "player_login", indexes = 
		{
				@org.hibernate.annotations.Index(name = "IDX_LOGIN", columnNames = { "eventTime","sessionId"}),
				@org.hibernate.annotations.Index(name = "IDX_ACCOUNT_NUMBER", columnNames = { "accountNumber"}),
				@org.hibernate.annotations.Index(name = "IDX_CLIENT_IP", columnNames = { "clientIp"}),
				@org.hibernate.annotations.Index(name = "IDX_COOP_ACCOUNT_ID", columnNames = { "cooperatorAccountId"}),
				@org.hibernate.annotations.Index(name = "IDX_GUID", columnNames = { "guid"})				
		})
public class PlayerLoginLogModel extends BasicLogModel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 9096060854475391972L;
	
	
	/**
	 * 帳戶id
	 */
	private String accountId;
	
	/**
	 * 營運商accountID
	 */
	private String cooperatorAccountId;

	/**
	 * 營運商 id
	 */
	private String venderId;
	
	/**
	 * 子營運商 id
	 */
	private String subVenderId;

	/**
	 * 自身id
	 */
	private String guid;
	
	
	/**
	 * sessionId
	 * 用來判斷是否為同一次登入登出 
	 */
	private String sessionId;
	
	/**
	 * 角色名稱
	 */
	private String playerName;
	
	/**
	 *账户登录时客服端的IP
	 */
	@In
	private String clientIP;
	
	/**
	 * 是否為登入
	 * 用來檢查是記錄登入還是登出
	 * 0：登入，1：登出
	 */
	private int isLogin;
	
	/** 登入平台  **/
	private String loginPlatform;
	
	/** 版本號 **/
	private int verison;
	
	/**
	 * 會員帳號 
	 */
	private String accountNumber;

	public String getAccountId() {
		return accountId;
	}

	public void setAccountId(String accountId) {
		this.accountId = accountId;
	}

	public String getSessionId() {
		return sessionId;
	}

	public void setSessionId(String sessionId) {
		this.sessionId = sessionId;
	}

	public String getPlayerName() {
		return playerName;
	}

	public void setPlayerName(String playerName) {
		this.playerName = playerName;
	}

	public String getClientIP() {
		return clientIP;
	}

	public void setClientIP(String clientIP) {
		this.clientIP = clientIP;
	}

	public int getIsLogin() {
		return isLogin;
	}

	public void setIsLogin(int isLogin) {
		this.isLogin = isLogin;
	}

	public String getGuid() {
		return guid;
	}

	public void setGuid(String guid) {
		this.guid = guid;
	}

	public String getAccountNumber() {
		return accountNumber;
	}

	public void setAccountNumber(String accountNumber) {
		this.accountNumber = accountNumber;
	}

	public String getLoginPlatform() {
		return loginPlatform;
	}

	public void setLoginPlatform(String loginPlatform) {
		this.loginPlatform = loginPlatform;
	}

	@Column(columnDefinition="int default 0")
	public int getVerison() {
		return verison;
	}

	public void setVerison(int verison) {
		this.verison = verison;
	}
	
	public String getCooperatorAccountId() {
		return cooperatorAccountId;
	}

	public void setCooperatorAccountId(String cooperatorAccountId) {
		this.cooperatorAccountId = cooperatorAccountId;
	}
	
	@Column(columnDefinition="VARCHAR(50) NOT NULL default 'TONWA'")
	public String getVenderId() {
		return venderId;
	}

	public void setVenderId(String venderId) {
		this.venderId = venderId;
	}

	@Column(columnDefinition="VARCHAR(50) NOT NULL default 'TONWA'")
	public String getSubVenderId() {
		return subVenderId;
	}

	public void setSubVenderId(String subVenderId) {
		this.subVenderId = subVenderId;
	}
}
